package com.smedi.ismedi.inmail.core.port.adapter.service;

import com.smedi.ismedi.file.dto.request.SignatureRequest;
import com.smedi.ismedi.file.dto.response.FileInfoResponse;
import com.smedi.ismedi.inmail.core.domain.dto.AttachmentQuery;
import com.smedi.ismedi.web.starter.common.ResponseData;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.io.File;
import java.io.IOException;
import java.util.List;

public interface FileRemoteApi {
    FileInfoResponse getFileOne(AttachmentQuery attachmentQuery);

    List<FileInfoResponse> getFileList(AttachmentQuery attachmentQuery);

    List<FileInfoResponse> getFileListByPost(AttachmentQuery attachmentQuery);

    /**
     * 上传文件
     *
     * @param inputFile 文件
     * @return String 文件主键
     */
    String uploadFile(File inputFile) throws IOException;

    /**
     * 文件转pdf
     *
     * @param inputFileKey 文件
     * @return String 文件主键
     */
    String convertToPdf(String inputFileKey);

    /**
     * 签章
     *
     * @param signatureRequests 签章请求
     * @return ResponseData<FileInfoResponse>
     */
    String postSignatures(@Validated @RequestBody List<SignatureRequest> signatureRequests);
}